package com.emokili.ewa.app.controller;

import com.alibaba.fastjson.JSON;
import com.emokili.ewa.common.utils.JsonUtils;
import com.emokili.ewa.common.utils.R;
import com.emokili.ewa.core.frame.vo.TestVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


import java.util.concurrent.atomic.AtomicInteger;

@Slf4j
@RequestMapping("/csn/csn")
@RestController
public class TestController {

    private AtomicInteger atomicInteger = new AtomicInteger(0);

    @PostMapping(value = "/send")
    @ResponseBody
    public R send(@RequestBody TestVo testVo) {

        log.info("testVo is {}", JsonUtils.objectToJson(testVo));
        int i = atomicInteger.addAndGet(1);
        log.info("request times == {}",i);

        return R.ok().setData(i);
    }
}
